GetUsers Method

Syntax

GetUsers as P (ou as C)

Arguments

ouCharacter

The name of an organizational unit from which to restrict the list of users. Defaults to empty string.

Returns

usersArray of WindowsServices::ActiveDirectory::User (use as type P)

Returns an array of WindowsServices::ActiveDirectory::User objects. Check the domain object's CallResult to see if the method succeeds.

Description

Get the users for a WindowsServices::ActiveDirectory::Domain object. Optionally restrict the users to a specific organizational unit.

'The follow line assumes that the machine is joined to an Active Directory domain and is allow to query Active Directory.
dim domain as WindowsServices::ActiveDirectory::Domain = new WindowsServices::ActiveDirectory::Domain()
if .not. domain.CallResult.Success then
	?"There was an error connecting to an Active Directory domain: " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if
	
?"The domain name is " + domain.Name + crlf()

dim users as p = domain.getUsers("")
if .not. domain.CallResult.Success then
	?"There was an error getting users: " + domain.CallResult.Text + crlf()
	goto exitTestFunction
end if

for each user in users
	?user.Name + crlf()
next
	
exitTestFunction: